﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
/// <summary>
/// Tourist_users 的摘要说明
/// </summary>
public class Tourist_users:SQlHelper
{
	public Tourist_users()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}
    private string _id;
    private string _name;
    private string _ps;
    private string _destination;
    public string id
    {
        get 
        { 
            return _id;
        }
        set
        { 
            _id = value;
        }
    }
    public string name
    {
        get
        {
            return _name;
        }
        set
        {
            _name = value;
        }
    }
    public string ps
    {
        get
        {
            return _ps;
        }
        set
        {
            _ps = value;
        }
    }
    public string destination
    {
        get
        {
            return _destination;
        }
        set
        {
            _destination = value;
        }
    }
    //添加消费者信息
    public int Toutist(Tourist_users tmp)
    {
        string sql = "insert into Tourist_users(Tourist_Name,Tourist_Password) values('" + tmp.name+ "','" + tmp.ps+ "')";
        int result = tmp.ExeNonquery(sql);
        return result;
    }
    //查看姓名是否可用
    public int Tourist_users1(Tourist_users tmp)
    {
        string sql = "select count(*)from Tourist_users where Tourist_Name='" + tmp.name + "'";
        int result = tmp.ExeScalar(sql);
        return result;
    }
    //登录消费者
    public int denglu(Tourist_users tmp)
    {
        string sql = "select count(*) from Tourist_users where Tourist_Name='" + tmp.name + "'and Tourist_Password='" + tmp.ps + "'";
        int result = tmp.ExeScalar(sql);
        return result;
    }
   
}